home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Pascal / Applications / P4⁄Mac 2.0d4 / Original source & doc / differences next >
Encoding:
Text File  |  1994-07-28  |  6.2 KB  |  201 lines  |  [TEXT/ttxt]

  1. The code here is slightly different from that in the book, but the
  2. line numbers have been kept the same.  The changes were to allow
  3. modern Pascal compilers to compile the source (there were some
  4. laxities in the original code). The following are the changes:
  5.  
  6. The type marktype is added for the parameters of the routines mark and
  7. release:
  8.     76c76
  9.     < 
  10.     ---
  11.     >      marktype= ^integer;
  12.  
  13. The type setty (which represents set types) is added for the new type
  14. compatibility rules of ISO Pascal:
  15.     95c95
  16.     < 
  17.     ---
  18.     >      setty = set of setlow..sethigh;
  19.     100c100
  20.     <                          pset: (pval: set of setlow..sethigh);
  21.     ---
  22.     >                          pset: (pval: setty);
  23.  
  24. Missing variant parts:
  25.     123c123
  26.     <                                   declared: (fconst: ctp));
  27.     ---
  28.     >                                   declared: (fconst: ctp); standard: ());
  29.     145a146
  30.     >                      types: ();
  31.     149,150c150
  32.     <                      proc,
  33.     <                      func:  (case pfdeckind: declkind of
  34.     ---
  35.     >                      proc, func:  (case pfdeckind: declkind of
  36.     154,155c154,155
  37.     <                                            actual: (forwdecl, extern:
  38.     <                                                     boolean)))
  39.     ---
  40.     >                                            actual: (forwdecl, extern: boolean);
  41.     >                                            formal: ()))
  42.  
  43. Pcom has the files prr and prd as standard identifiers. You have to
  44. declare them for other compilers:
  45.     193d192
  46.     < 
  47.     194a194
  48.     >     prr: text; (* comment this out when compiling with pcom *)
  49.     299d298
  50.     < 
  51.  
  52. Other compilers don't have the routines mark and release. Their
  53. effective semantics are null; you just waste heap:
  54.     300a300,301
  55.     >   procedure mark(var p: marktype); begin end;
  56.     >   procedure release(p: marktype); begin end;
  57.     302d302
  58.     < 
  59.  
  60. Output the line number with error messages, so that if the listing
  61. option has been switched off, you still know which line is in error:
  62.     307c307
  63.     <       begin write(output,' ****  ':15);
  64.     ---
  65.     >       begin write(output,linecount:6,' ****  ':9);
  66.  
  67. Accept tabs as white-space as well:
  68.     398c398
  69.     <     repeat while (ch = ' ') and not eol do nextch;
  70.     ---
  71.     >     repeat while ((ch = ' ') or (ch = '    ')) and not eol do nextch;
  72.  
  73. Jumping from the then part of an if into the else part is not allowed;
  74. fix cases like 1..10 in another way:
  75.     429c429
  76.     <           if (ch = '.') or (ch = 'e') then
  77.     ---
  78.     >           if ((ch = '.') and (input^ <> '.')) or (ch = 'e') then
  79.     434c434
  80.     <                       nextch; if ch = '.' then begin ch := ':'; goto 3 end;
  81.     ---
  82.     >                       nextch; (*if ch = '.' then begin ch := ':'; goto 3 end;*)
  83.  
  84. Fix modern type mismatches:
  85.     668c668
  86.     <   procedure align(fsp: stp; var flc: integer);
  87.     ---
  88.     >   procedure align(fsp: stp; var flc: addrrange);
  89.  
  90. An identifier misspelled after the 8th character:
  91.     872c872
  92.     <           if sy = stringconstsy then
  93.     ---
  94.     >           if sy = stringconst then
  95.  
  96. Unused variables, and new type names:
  97.     1529,1531c1529,1531
  98.     <       var oldlev: 0..maxlevel; lsy: symbol; lcp,lcp1: ctp; lsp: stp;
  99.     <           forw: boolean; oldtop: disprange; parcnt: integer;
  100.     <           llc,lcm: addrrange; lbname: integer; markp: ^integer;
  101.     ---
  102.     >       var oldlev: 0..maxlevel; lcp,lcp1: ctp; lsp: stp;
  103.     >           forw: boolean; oldtop: disprange;
  104.     >           llc,lcm: addrrange; lbname: integer; markp: marktype;
  105.     1535c1535
  106.     <           llc: addrrange; count,lsize: integer;
  107.     ---
  108.     >           llc,lsize: addrrange; count: integer;
  109.     1819c1819
  110.     <           i, entname, segsize: integer;
  111.     ---
  112.     >           entname, segsize: integer;
  113.     2087c2087
  114.     <         var lattr: attr; lcp: ctp; lsize,lmin,lmax: integer;
  115.     ---
  116.     >         var lattr: attr; lcp: ctp; lsize: addrrange; lmin,lmax: integer;
  117.     2248c2248
  118.     <             var lcp:ctp; llev:levrange; laddr:addrrange;
  119.     ---
  120.     >             var llev:levrange; laddr:addrrange;
  121.     2306c2306
  122.     <                 lcp:ctp; llev:levrange; laddr,len:addrrange;
  123.     ---
  124.     >                 llev:levrange; laddr,len:addrrange;
  125.     2456,2457c2456,2457
  126.     <             var lsp,lsp1: stp; varts,lmin,lmax: integer;
  127.     <                 lsize,lsz: addrrange; lval: valu;
  128.     ---
  129.     >             var lsp,lsp1: stp; varts: integer;
  130.     >                 lsize: addrrange; lval: valu;
  131.     2750c2750
  132.     <                     cstpart: set of 0..47; lsp: stp;
  133.     ---
  134.     >                     cstpart: setty; lsp: stp;
  135.  
  136. Unix pc can't cope with this line:
  137.     2926c2926
  138.     <             (*/*)     rdiv: begin
  139.     ---
  140.     >             (* / *)   rdiv: begin
  141.  
  142. More unused variables:
  143.     3318c3318
  144.     <           var lattr: attr; lsp: stp;  lsy: symbol;
  145.     ---
  146.     >           var lattr: attr;  lsy: symbol;
  147.     3642c3642
  148.     <     var sp: stp;
  149.     ---
  150.     > 
  151.  
  152. Produce code as default:
  153.     3800c3800
  154.     <     prtables := false; list := true; prcode := false; debug := true;
  155.     ---
  156.     >     prtables := false; list := true; prcode := true; debug := true;
  157.  
  158. Unused variable:
  159.     3868c3868
  160.     <       var i: integer; ch: char;
  161.     ---
  162.     >       var i: integer;
  163.  
  164. Other compilers need to rewrite prr before using it:
  165.     3995,3996c3995,3996
  166.     <   (*compile:*)
  167.     <   (**********)
  168.     ---
  169.     >   (*compile:*) rewrite(prr); (*comment this out when compiling with pcom *)
  170.     >   (**********)
  171.  
  172. And all variables called 'extern' have been renamed to 'externl'.
  173.  
  174. Differences in the interpreter are minimal:
  175.  
  176. a set type has been added:
  177.     45a46
  178.     >       settype     = set of 0..58;
  179.     63c64
  180.     <                                 sett       :(vs :set of 0..47);
  181.     ---
  182.     >                                 sett       :(vs :settype);
  183.     225c226
  184.     <       var name :alfa;  b :boolean;  r :real;  s :set of 0..58;
  185.     ---
  186.     >       var name :alfa;  b :boolean;  r :real;  s :settype;
  187.  
  188. the initial writeln has been removed:
  189.     667c667
  190.     <   writeln(output); (* for testing *)
  191.     ---
  192.     >   (* writeln(output); for testing *)
  193.  
  194. and the type alfa has been added:
  195.     47c47
  196.     < 
  197.     ---
  198.     >       alfa      = packed array[1..10] of char;
  199.  
  200. End of differences
  201.